package cn.com.cifi.mars.bean.vo.price;

import cn.com.cifi.mars.util.MathUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * @author plx
 */
@ApiModel("去化率报表")
@Data
public class RemovalReportVO implements Serializable{

    @ApiModelProperty("组织ID")
    private String orgId;

    @ApiModelProperty("父级ID")
    private String parentOrgId;

    @ApiModelProperty("组织名称")
    private String orgName;

    @ApiModelProperty("组织类型")
    private String orgType;

    @ApiModelProperty("房间均价")
    private BigDecimal roomAvgPrice;

    @ApiModelProperty("车位均价")
    private BigDecimal carPlateAvgPrice;

    @ApiModelProperty("房间总金额")
    private BigDecimal roomTotalPrice;

    @ApiModelProperty("车位总金额")
    private BigDecimal carPlateTotalPrice;

    @ApiModelProperty("总金额")
    private BigDecimal totalPrice;

    @ApiModelProperty("房间套数")
    private Integer roomCount;

    @ApiModelProperty("车位个数")
    private Integer carPlateCount;

    @ApiModelProperty("权益货值")
    private BigDecimal rightPrice;

    @ApiModelProperty("面积")
    private BigDecimal area;

    @ApiModelProperty("房间去化率")
    private BigDecimal roomRemovalRate;

    @ApiModelProperty("车位去化率")
    private BigDecimal carPlateRemovalRate;

    @ApiModelProperty("面积去化率（房间）")
    private BigDecimal areaRemovalRate;

    @ApiModelProperty("总金额去化率（房间+车位）")
    private BigDecimal totalPriceRemovalRate;

    @ApiModelProperty("总套数去化率（房间+车位）")
    private BigDecimal totalCountRemovalRate;

    @ApiModelProperty("房间金额去化率")
    private BigDecimal roomTotalPriceRemovalRate;

    @ApiModelProperty("车位金额去化率")
    private BigDecimal carPlateTotalPriceRemovalRate;

    @ApiModelProperty("是否车位")
    private Integer isParking;

    @ApiModelProperty("分组CODE")
    private String groupCode;

    @ApiModelProperty("分组名称")
    private String groupName;


    public void addToParent(RemovalReportVO parent){
        parent.setRoomCount(MathUtils.integerAdd(this.roomCount, parent.getRoomCount()));
        parent.setCarPlateCount(MathUtils.integerAdd(this.carPlateCount, parent.getCarPlateCount()));
        parent.setArea(MathUtils.bigDecimalAdd(this.area, parent.getArea()));
        parent.setRoomTotalPrice(MathUtils.bigDecimalAdd(this.getRoomTotalPrice(), parent.getRoomTotalPrice()));
        parent.setCarPlateTotalPrice(MathUtils.bigDecimalAdd(this.carPlateTotalPrice, parent.getCarPlateTotalPrice()));
        parent.setRightPrice(MathUtils.bigDecimalAdd(this.rightPrice, parent.getRightPrice()));

    }


}
